<script language="javascript">
    // apply filters  
    jQuery(document).ready(function(){
        jQuery("#list_etapas").jqGrid({
            url: '<?php echo site_url() ?>/outbound/data2',
            mtype: 'POST',
            datatype: 'json',
            colNames:['ID','Comentario','Fecha Registro','Usuario'],
            colModel :[ 
                {name:'idSOutbound', index:'idSOutbound', width:2,hidden:true},
                {name:'tipoOutbound',index:'tipoOutbound',width:30},
                {name:'fechaOutBound', index:'fechaOutBound',width:30},
                {name:'proximaLlamada', index:'proximaLlamada',width:30},],
            pager: jQuery('#pager_etapas'),
            hiddengrid: false,
            sortname: 'idSOutbound',
            rowNum:10,
            rowList:[10,20,30,40,50],
            sortorder: "desc",
            height: '100%',
            width: '600',
            imgpath: _base_url + 'public/css/jqgrid/flex/images',
            viewrecords: true,
            multiselect: false,
            editurl:"http://localhost/company24h/index.php/etapastrx/save",
            adjacents: 4,
			onSelectRow: function(id) 
			{
				 
            	if(ids != null) 
            	{
            		 
            		var rec = jQuery("#list_etapas").getRowData(id);	
            	}
            },
			afterInsertRow: function(rowid, aData){
                                 switch (aData.activa) {
                                     case '1': jQuery("#list_etapas").setCell(rowid,'activa','<img src="' + _base_url + 'public/images/accept.png" />',{color:'green'});
                                         break;
                                     case '0': jQuery("#list_etapas").setCell(rowid,'activa','<img src="' + _base_url + 'public/images/close.png" />',{color:'#ccc'});
                                         break;
								}
								 
								 switch (aData.completada) {
                                     case '1': jQuery("#list_etapas").setCell(rowid,'completada','<img src="' + _base_url + 'public/images/accept.png" />',{color:'green'});
                                         break;
                                     case '0': jQuery("#list_etapas").setCell(rowid,'completada','<img src="' + _base_url + 'public/images/close.png" />',{color:'#ccc'});
                                         break;
                                 }},
            jsonReader: { repeatitems : false, id: "0" }
        }).navGrid('#pager_etapas', {add:false,edit:false,del:false,search:false}, //options 
        {height:280,reloadAfterSubmit:true}, // edit options 
        {height:280,reloadAfterSubmit:false}, // add options 
        {reloadAfterSubmit:false}, // del options 
        {} // search options 
        );
    }); 
</script>
<div class="table_container">
<table>
<tr><td><div id="titulo">lista de Proseso De Outbound<hr /></div><br /></td></tr>
<tr>
<td>
    <table id="list_etapas" class="scroll"></table>
    <div id="pager_etapas" class="scroll" style="text-align:center;"></div>
</td>
 </tr>
 </table>

</div>